< previous page page_45 next page >

Page 45
object from the left side of the object's container. The Top property specifies the distance of the top edge of an object from the top edge of its container. In the case of a standard form, the container is the entire screen. If you draw a control on a form, the form is the control's container. I should also mention that some controls themselves, such as the PictureBox and Frame controls, can act as containers for other controls.
0045-01.jpg
Figure 3.6
This TextBox control's position is measured relative to the form, which is its container.
note.gif An object's Top and Left properties can actually have a negative value. For example, a Label control whose Left property value is 1440 is positioned so that its left edge is approximately one inch to the left of its container; therefore, some (or all) of it can't be seen. square.gif

Whereas the position of most forms is measured in relation to the upper-left corner of the screen, a form that is part of a Multiple Document Interface (MDI) application is positioned relative to the upper-left corner of the client area of the parent form (see Figure 3.7).
0045-02.jpg
Figure 3.7
An MDI child form is positioned relative to its parent form.
Changing Properties at Runtime
As you've learned, objects' properties can be changed at runtime, either through user action or program code. At this point, you can work through an exercise that illustrates this concept. This sample project presents the users with a standard form. They can modify the form's size or position simply by using the mouse to drag the form or one of its edges. The form also has a command button that programmatically increases the form's width and another that

 
< previous page page_45 next page >